package com.xiake.consultsystem.controller;


import com.xiake.consultsystem.service.ConsultRecordService;
import com.xiake.consultsystem.pojo.vo.Result;
import com.xiake.consultsystem.utils.Constant;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Mr.Chen
 * @since 2022-11-13
 */
@RestController
@RequestMapping("/consultRecord")
public class ConsultRecordController {
    @Autowired
    ConsultRecordService consultRecordService;
    /**
     * 学生进行预约的接口,需要参数: 预约的日期 \ 时间段id \ 咨询师id
     */

    @ApiOperation("学生进行预约的接口")
    @PostMapping("/makeAppoint")
    public Result makeAppoint(
            @RequestParam @DateTimeFormat(pattern = Constant.DATE_FORMAT) Date date,
            @RequestParam Long timeId,
            @RequestParam Long counselorId) {
        return consultRecordService.makeAppoint(date,timeId,counselorId);
    }

}

